Skip to content

fix: Godot client sync improvements (sex display, fleeing, predation guards)#90

Merged
biosynthart merged 3 commits into
hellolifeforms:mainfrom
biosynthart:fix/godot-client-sync
Jun 22, 2026
Merged

fix: Godot client sync improvements (sex display, fleeing, predation guards)#90
biosynthart merged 3 commits into
hellolifeforms:mainfrom
biosynthart:fix/godot-client-sync

Conversation

@biosynthart

Copy link
Copy Markdown
Member

Summary

This branch syncs and improves the Godot client with several behavioral fixes and feature additions for mobile consumers.

Changes

2 New Commits (since last sync)

1. feat: add feeding bout momentum and population-based insect predation

  • MIN_FORAGING_BOUT_FEEDS (3): Entities must complete at least 3 successful feeding events before the guard allows FORAGING/HUNTING exit. Prevents the 'one bite → exit → rest 37 ticks' cycle where a single relief value exceeds the hunger hysteresis gap.
  • OMNIVORE_INSECT_MIN_PREY_COUNT (5): Omnivores skip insect/pollinator predation when living prey count is below 5. Prevents early extinction of small prey populations and lets omnivores fall back to plant foraging.
  • Track _foraging_bout_feeds counter: reset on FORAGING/HUNTING entry, incremented on each successful predation or herbivory event.

2. feat: add sex display for mobile consumers and improve fleeing exit logic

  • Add sex field serialization in engine (updates + spawns) for ANIMAL/BIRD/INSECT
  • Add sex field to WorldEntity and apply it on updates/spawns
  • Display sex symbol (♂/♀) in selection billboard for sexed entity types
  • Add sex info to the drive legend for ANIMAL, BIRD, INSECT types
  • Add FLEE_MAX_DURATION constant: force exit FLEEING after 15 ticks
  • Add FLEE_REPRO_DRIVE_EXIT constant: abandon fleeing when reproductive drive > 0.6
  • Track _flee_start_tick in FleeActor so guard can enforce timeout

Earlier commits already in this branch

  • fix: grow direction must be 0-2 in Godot 4
  • fix: invalid grow direction in LegendLabel tscn
  • fix: repair broken file headers in python client
  • fix: add flee direction caching to browser and python clients
  • fix: butterfly fleeing stuck state and add HUD stat legend
  • feat(godot): add click-to-select with entity highlight
  • Add standardized headers to Python client files
  • Add standardized file headers to all Godot client GDScript files

Testing

  • Verified feeding bout momentum prevents premature exit from foraging/hunting states
  • Verified omnivores respect minimum prey count threshold before targeting insects
  • Verified sex symbols display correctly in Godot client billboards
  • Verified fleeing timeout and reproductive drive exit work as expected

…ogic

- Add sex field serialization in engine (updates + spawns) for ANIMAL/BIRD/INSECT
- Add sex field to WorldEntity and apply it on updates/spawns
- Display sex symbol (♂/♀) in selection billboard for sexed entity types
- Add sex info to the drive legend for ANIMAL, BIRD, INSECT types
- Add FLEE_MAX_DURATION constant: force exit FLEEING after 15 ticks
- Add FLEE_REPRO_DRIVE_EXIT constant: abandon fleeing when reproductive drive > 0.6
- Track _flee_start_tick in FleeActor so guard can enforce timeout
- Add MIN_FORAGING_BOUT_FEEDS (3): entities must complete at least 3
  successful feeding events before the guard allows FORAGING/HUNTING exit.
  Prevents the 'one bite → exit → rest 37 ticks' cycle where a single
  relief value exceeds the hunger hysteresis gap.

- Add OMNIVORE_INSECT_MIN_PREY_COUNT (5): omnivores skip insect/pollinator
  predation when living prey count is below 5. This prevents early extinction
  of small prey populations (e.g. 4 butterflies at sim start) and lets
  omnivores fall back to plant foraging instead.

- Track _foraging_bout_feeds counter: reset on FORAGING/HUNTING entry,
  incremented on each successful predation or herbivory event.
- Remove unused FLEE_MAX_DURATION import (used only in guard_actors)
- Remove unused MIN_FORAGING_BOUT_FEEDS import (used only in guard_actors)
- Remove unused insect_groups variable in _count_living_insect_prey
@biosynthart biosynthart merged commit 2643b93 into hellolifeforms:main Jun 22, 2026
2 checks passed
biosynthart added a commit that referenced this pull request Jun 22, 2026
- Add godot_debug.png to README.md quick start section
- Expand architecture diagram to include Godot 3D client as third client
- Update 'Two clients' → 'Three clients' in key features
- Update LILA_PROJECT_STATE.md: Godot client marked as 'Shipped'
  with PR #90 sync fixes and recent feature additions
- New client/godot/README.md with architecture, controls, and
  development guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant